package com.cn.zengzeng.spbzengzeng.clone.json;

import com.alibaba.fastjson.JSONObject;

/**
 * @Description:
 * @Author: ZhangZengZeng
 * @Date: 2022/5/9 15:33
 */
public class Demo {

    public static void main (String[] args) throws CloneNotSupportedException {
        User user = new User("1111","23");
        user.setAddrss("陕西","西安");
        System.out.println("user = " + user);
        User user1 = JSONObject.parseObject(JSONObject.toJSONString(user),User.class);
        System.out.println("user1 = " + user1);
        user1.setAddrss("山西","大同");
        System.out.println("user1 = " + user1);

        System.out.println("deep克隆开始");
        User clone = (User) user.clone();
        System.out.println("clone = " + clone);
    }
}
